{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div align=\"right\" style=\"text-align:right\"><a href=\"http://norvig.com\">Peter Norvig</a><br>March 2019</div>\n",
    "\n",
    "#  Baseball Simulation\n",
    "\n",
    "The [538 Riddler for March 22, 2019](https://fivethirtyeight.com/features/can-you-turn-americas-pastime-into-a-game-of-yahtzee/) asks us to simulate baseball using probabilities from a 19th century dice game called *Our National Ball Game*. The Riddler description of the rules said *you can assume some standard baseball things* but left many things unspecified, so I [looked up](http://baseballgames.dreamhosters.com/BbDiceHome.htm) the original rules of *Our National Ball Game*, which are shown below and which, it turns out, contradict some of the *standard baseball things* assumed by 538. I'll go with the rules as stated below.\n",
    "\n",
    "\n",
    "|RULES FOR PLAYING \"OUR NATIONAL BALL GAME\"|DICE ROLL OUTCOMES|\n",
    "|-----|-----|\n",
    "| ![](http://baseballgames.dreamhosters.com/bbOurNationalBallGameMcGillDelanyHoag86diE2.jpg) |  ![](http://baseballgames.dreamhosters.com/bbOurNationalBallGameMcGillDelanyHoag86ddE.jpg) |\n",
    "\n",
    "# Design Choices\n",
    "\n",
    "\n",
    "- Exactly one thing happens to each batter. I'll call that an **event**.\n",
    "- To clarify: the dice roll `1,1` has probability 1/36, whereas `1,2` has probability 2/36, because it also represents `2,1`.\n",
    "- The \"One Strike\" dice roll is not an event; it is only *part* of an event. From the probability of a \"One Strike\" dice roll, 7/36, I compute the probability of three strikes in a row, `(7/36)**3 == 0.00735`, and call that a strikeout event. \n",
    "- I'll represent events with the following 11 one letter **event codes**:\n",
    "  - `1`, `2`, `3`, `4`: one-, two-, three-, and four-base (home run) hits. Runners advance same number of bases.\n",
    "  - `B`: base on balls. Runners advance only if forced.\n",
    "  - `D`: double play. Batter and runner nearest home are out; others advance one base.\n",
    "  - `E`: error. Batter reaches first and all runners advance one base.\n",
    "  - `F`, `K`, `O`: fly out, strikeout, foul out. Batter is out, runners do not advance.\n",
    "  - `S`: called \"out at first\" in rules, but actually a sacrifice. Batter is out, runners advance one base.\n",
    "\n",
    "\n",
    "#  Implementation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import random\n",
    "from statistics import mean, stdev\n",
    "from collections import Counter\n",
    "from itertools import islice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "event_codes = {\n",
    "    '1': 'single',        '2': 'double',      '3': 'triple',   '4': 'home run',\n",
    "    'B': 'base on balls', 'D': 'double play', 'E': 'error',\n",
    "    'F': 'fly out',       'K': 'strikeout',   'O': 'foul out', 'S': 'out at first'}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "I'll define the function `inning` to simulate a half inning and return the number of runs scored.  Design choices for `inning`:\n",
    "\n",
    "- I'll keep track of runners with a set of occupied bases; `runners = {1, 3}` means runners on first and third.\n",
    "- I'll keep track of the number of `runs` and `outs` in an inning, and return the number of `runs` when there are three `outs`.\n",
    "- Each event follows four steps. If `runners = {1, 3}` and the event is `'2'` (a double), then the steps are:\n",
    "  - The batter steps up to the plate. The plate is represented as base `0`, so now `runners = {0, 1, 3}`.\n",
    "  - Check if the event causes runner(s) to be out, and if the inning is over. In this case, no.\n",
    "  - Advance each runner according to `advance(r, e)`. In this case, `runners = {2, 3, 5}`.\n",
    "  - Remove the runners who have `scored` and increment `runs` accordingly. In this case, runner `5` has scored, so we increment `runs` by 1 and end up with `runners = {2, 3}`.\n",
    "- I want `inning` to be easily **testable**: I want to say `assert 2 = inning('1KO4F')`.\n",
    "- I also want `inning` to be capable of simulating many independent random innings.  So the interface is to accept an *iterable* of event codes. That could be string, or a generator, as provided by `event_stream()`.\n",
    "- I want `inning` to be **loggable**: calling `inning(events, verbose=True)` should produce printed output for each event.\n",
    "- `advance(r, e)` says that a runner advances `e` bases on an `e` base hit; one base on an error, sacrifice, or double play; and one base on a base on balls only if forced.\n",
    "- A runner on base `r` is `forced` if all the lower-numbered bases have runners.\n",
    "- `ONBG` is defined as a generator of random events with the probabilities from \"Our National Ball Game\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def inning(events, verbose=True) -> int:\n",
    "    \"\"\"Simulate a half inning based on events, and return number of runs scored.\"\"\"\n",
    "    outs = runs = 0     # Inning starts with no outs and no runs,\n",
    "    runners = set()     # and with nobody on base\n",
    "    def out(r) -> int: runners.remove(r); return 1\n",
    "    def forced(r) -> bool: return all(b in runners for b in range(r))\n",
    "    def advance(r, e) -> int: \n",
    "        return int(e if e in '1234' else (e in 'ESD' or (e == 'B' and forced(r))))\n",
    "    for e in events:\n",
    "        if verbose: show(outs, runs, runners, e)\n",
    "        runners.add(batter)      # Batter steps up to the plate\n",
    "        if e == 'D' and len(runners) > 1: # Double play: batter and lead runner out\n",
    "            outs += out(batter) + out(max(runners))\n",
    "        elif e in 'DSKOF':       # Batter is out\n",
    "            outs += out(batter)  \n",
    "        if outs >= 3:            # If inning is over: return runs scored\n",
    "            return runs \n",
    "        runners = {r + advance(r, e) for r in runners} # Runners advance\n",
    "        runs += len(runners & scored)                  # Tally runs\n",
    "        runners = runners - scored                     # Remove runners who scored\n",
    "        \n",
    "def event_stream(events, strikes=0):\n",
    "    \"\"\"A generator of random baseball events.\"\"\"\n",
    "    while True:\n",
    "        yield 'K' if (random.random() < strikes ** 3) else random.choice(events)\n",
    "\n",
    "def show(outs, runs, runners, event):\n",
    "    \"\"\"Print a representation of the current state of play.\"\"\"\n",
    "    bases = ''.join(b if int(b) in runners else '-' for b in '321')\n",
    "    print(f'{outs} outs {runs} runs  {bases}  {event} ({event_codes[event]})')\n",
    "    \n",
    "ONBG   = event_stream('2111111EEBBOOSSSSSSSFFFFFD334', 7/36) # Our National Ball Game\n",
    "batter = 0             # The batter is not yet at first base\n",
    "scored = {4, 5, 6, 7}  # Runners in these positions have scored"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Examples and Tests\n",
    "\n",
    "Let's peek at some random innings:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  3 (triple)\n",
      "0 outs 0 runs  3--  F (fly out)\n",
      "1 outs 0 runs  3--  S (out at first)\n",
      "2 outs 1 runs  ---  F (fly out)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning(ONBG)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  F (fly out)\n",
      "1 outs 0 runs  ---  S (out at first)\n",
      "2 outs 0 runs  ---  S (out at first)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning(ONBG)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's also test some historic innings. I'll take some of the Red Sox innings from their 2004 playoff series against the Yankees."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  K (strikeout)\n",
      "1 outs 0 runs  ---  2 (double)\n",
      "1 outs 0 runs  -2-  O (foul out)\n",
      "2 outs 0 runs  -2-  1 (single)\n",
      "2 outs 0 runs  3-1  2 (double)\n",
      "2 outs 1 runs  32-  1 (single)\n",
      "2 outs 2 runs  3-1  4 (home run)\n",
      "2 outs 5 runs  ---  K (strikeout)\n"
     ]
    }
   ],
   "source": [
    "# 7th inning in game 1: 5 runs (Homer by Varitek)\n",
    "# (But not a perfect reproduction, because our simulation doesn't have passed balls.)\n",
    "assert 5 == inning('K2O1214K')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  S (out at first)\n",
      "1 outs 0 runs  ---  S (out at first)\n",
      "2 outs 0 runs  ---  2 (double)\n",
      "2 outs 0 runs  -2-  1 (single)\n",
      "2 outs 0 runs  3-1  1 (single)\n",
      "2 outs 1 runs  -21  4 (home run)\n",
      "2 outs 4 runs  ---  F (fly out)\n"
     ]
    }
   ],
   "source": [
    "# 4th inning in game 6: 4 runs (Homer by Bellhorn)\n",
    "assert 4 == inning('SS2114F')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  S (out at first)\n",
      "1 outs 0 runs  ---  1 (single)\n",
      "1 outs 0 runs  --1  B (base on balls)\n",
      "1 outs 0 runs  -21  B (base on balls)\n",
      "1 outs 0 runs  321  4 (home run)\n",
      "1 outs 4 runs  ---  B (base on balls)\n",
      "1 outs 4 runs  --1  F (fly out)\n",
      "2 outs 4 runs  --1  S (out at first)\n"
     ]
    }
   ],
   "source": [
    "# 2nd inning in game 7: 4 runs (Grand Slam by Damon)\n",
    "assert 4 == inning('S1BB4BFS')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That looks good to me.\n",
    "\n",
    "# Simulation\n",
    "\n",
    "Now, simulate a hundred thousand innings, and then sample from them to simulate a hundred thousand nine-inning games (for one team), and show histograms of the results, labelled with statistics:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def simulate(N=100000, inning=inning, events=ONBG) -> None:\n",
    "    innings = [inning(events=events, verbose=False) for _ in range(N)]\n",
    "    games   = [sum(random.sample(innings, 9)) for _ in range(N)]\n",
    "    hist(innings, 'Runs/inning (for one team)')\n",
    "    hist(games,   'Runs/game (for one team)')\n",
    "    \n",
    "def hist(nums, title): \n",
    "    \"\"\"Plot a histogram and show some statistics.\"\"\"\n",
    "    plt.hist(nums, ec='black', bins=max(nums)-min(nums), align='left')\n",
    "    plt.xlabel(title)\n",
    "    plt.title(f'μ: {mean(nums):.2f}, σ: {stdev(nums):.2f}, max: {max(nums)}')\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEWCAYAAACEz/viAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAZYElEQVR4nO3de7RdZX3u8e9juKmogEREggQ1VlHboBFwIBVFMVAreooVjkJETulR8HKGVsFTpaJUo/VSRgUPCINAVUAqgggiIki9AUGQq0pEgQhCbBChIJrwO3/Md5PFZl/W3uxbyPczxhp7zne+75zvmllZz5qX9a5UFZKkddtjprsDkqTpZxhIkgwDSZJhIEnCMJAkYRhIkjAMJEkYBppCSbZMclaSW5NUkrl9tntZq//RnrK3JFmd5J6ex66T1PXB/flIkquTrEryT6PU3STJkiR3tMc/DVo+P8l/JrkryfIkH5rMvk+GJH+V5HtJfpfkN0mOS/KEnuV/m+QHSe5NctE0dlUjMAw0lR4Avgn8Tb8NkqwP/CtwyRCLf1hVG/c8LpqYbo5qGfA+4Bt91P0M8DhgLrADsF+SA3qWfwm4GNgMeBnwtiSvndDeTr4nAR8FngY8F5gDfLJn+Urgs8DHp75r6pdhoDFpn9Cf1TN/Yu8n9pFU1e1VdTRw2Rg2+R7gW8BPx9bT4SXZMMnnktzWji6qPb7WT/uqWlJV5wJ391H9r4FPVNW9VfUr4HjgrT3L5wJfrKrVVfUL4HvA8/p8HicmOTrJue3I6PtJnprks0n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rAY8MNOGq6i7gncB70w3PexOwXZINW1DsNto6kjyzqq6uqsV0pxyew/CniCbLpcDLkmza3uj+Zph61wPPGmbZJW0dm7fTZ/sC3x2mLvDg/ruz506k/UZrA5wHvK3tb5I8O93osr3uBp4wqM1b042lT7o7tJ5CF2x3tiB4Dt1psrF6NuvwaKRrI48MNCmq6op2mmGfqjo5yWnAVcANdKclRvPuJC+n+/R7HXAucDrwjsnq82BV9esk/0z3hn5r68ddQ1S9GPhUkvR8ah5Yx21JDgMupPskfk5V9TMc8SLg80keB9wIHDBK/S/Qnab5cZLQnbZ6yE8lVtV/Jfl+u3B+brtu8Fzgh10T7gHeTBe4/zvJVcDP6E4VjdXLgW+Mo52mibeWaq2QZEPg+1W1YIq3u3FV3dOODM6gG9r8jCHq/Svw9ar69lT2byZq/1bfBV7ac61HM5xhII0gyb/QnT/fCPgW8K7Bn/5bvS2AHatqnf9BpCTzgK2q6qLp7ov6ZxhIkryALEkyDCRJGAaSJAwDSRKGgSQJ+P8WmtcMLwEONQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEWCAYAAACKSkfIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfuElEQVR4nO3dfZxcVZ3n8c/XBAjKQxJosE0nBjWIOCuBiQHFByRuCBnX4I6s4AMNk504Iz6w6mJw1SjIDMgowiIoSiQoiqijBIYFYyT4yEMgEAjBSQQhTZ4aEgIIIoTf/nFPmZtOVVd1p7v64Xzfr1e96t5zz7333Jv0r06de+ocRQRmZpaHFw10AczMrHkc9M3MMuKgb2aWEQd9M7OMOOibmWXEQd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Q2geq36PpwEmpnLdSDBE8qUaZKqan1zLgTor7WNnno5LuBm6hGJSwkv4X4Ia0fA9wc0Q8l5YrZYFioLqX1Tm/DULDfZRN6z/PRMTkFMCuo2jTv5BixqpyZWJUl/0qY5xsJf3/i4hzJP0HRc32Fklvpwg+ayLiL2nwtFrOogju71Ixbv6SKueCYvydZ0vLI1M5H49i6OFur5Xiw6Wa7sr254jYWufY1exwj9J5PhIRN/bgOAL+NSK+sV1iMQ7N24E3RMTTKkbfrPw7PRcRlbFZ/nrPIuIFSeV4MYrivtgQ45q+7ZSI2AJ8FPikiqGMHwIOlrRb+kCYVu8Ykl4ZEfdExLkUzRYHUUxxWalx3g+8IgV1gPeUdt8bqDzoPbmHZX8CeFDS8akcknRIlawrgVfVOMytwFsl7Zse1p4I3Fwjb+W8W4DNpZ4/H6i3D3Aj8M/pHiPpQEkv6ZLnSYrmrPI+/5C+0SBpnKT9KO7Z5hTwD6IYbrmnDqRoFrIhxkHfdlpELAPuBk6IiDUUo1gup2jqWNbAIU5LD0Hvpqg9/j+KOX5vSMd/huIZwA2Sfk0xcuiWtO+XgH+V9BuK5ws99T5gdjr3CqpPp/lL4NBq3ziimH3rDIrheu8G7oyIRobqbQfOk7ScYv7aM+vk/xZwH3Bnasr6Bl2+qUfEY8Bv0r08LyJ+BnwP+J2keyimCNyT4r6OTOc+i6KJp6feBvxHL/azAeZRNm3QkbQb8JuImFJK2yMinkqB92vAqog4v4lluoDiweXPm3XOwSr9+9wMvKn0/MWGCNf0bdCJiGfLAT/5x/QQcwVF88Q3dtyzX/0L8OImn3OwmgDMdcAfmlzTNzPLiGv6ZmYZcdA3M8uIg76ZWUYc9M3MMuKgb2aWkf8P1qSKlaLjlGYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 2.52 s, sys: 16.6 ms, total: 2.54 s\n",
      "Wall time: 2.58 s\n"
     ]
    }
   ],
   "source": [
    "%time simulate()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So, about 13 runs per game (per team). This shows that the dice game is not very realistic with respect to current-day baseball. It is true that games were higher-scoring 130 years ago, and perhaps a dice game is more fun when there is a lot of action.\n",
    "\n",
    "# Real Major League Baseball Stats\n",
    "\n",
    "Could I make the game reflect baseball as it is played today? To do so I would need:\n",
    "1. A source of major league baseball (MLB) statistics.\n",
    "2. A way to convert those statistics into the format expected by the function `inning`.\n",
    "3. Possibly some modifications to  `inning`, depending on how the conversion goes.\n",
    "\n",
    "[Baseball-reference.com](https://www.baseball-reference.com) has lots of stats, in particular \n",
    "[MLB annual batting stats](https://www.baseball-reference.com/leagues/MLB/bat.shtml) and\n",
    "[fielding stats](https://www.baseball-reference.com/leagues/MLB/field.shtml); I'll use the stats for the complete 2019 season. The batting stats have most of what we need, and the fielding stats give us double plays and errors.\n",
    "\n",
    "I start by defining two utility functions that can be useful for any tabular data: `cell_value`, which converts a table cell entry into an `int`, `float`, or `str` as appropriate; and `header_row_dict`, which creates a dict of `{column_name: value}` entries. The function `mlb_convert` then converts this format (a dict keyed by `H/2B/3B/HR` etc.) into the event code format (a string of `'1234...'`). As part of the conversion  I'll add hit-by-pitch (`HBP`) into the \"base on balls\" category, and I'll record all otherwise  unaccounted-for outs under the \"fly out\" (`F`) category (runners do not advance). With this understood, we won't need to change the function `inning` at all. (It is true that `mlb_convert` returns a very long string, equal in length to the number of plate appearances over the whole MLB season. But that takes up less space than storing one photo, so I'm not going to worry about it.)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def cell_value(entry, types=(int, float, str)):\n",
    "    \"\"\"Convert a cell entry into the first type that doesn't raise an error.\"\"\"\n",
    "    for typ in types:\n",
    "        try:\n",
    "            return typ(entry)\n",
    "        except ValueError:\n",
    "            pass\n",
    "    \n",
    "def header_row_dict(header, row, sep=None, value=cell_value) -> dict:\n",
    "    \"\"\"Parse a header and table row into a dict of `{column_name: value(cell)}`.\"\"\"\n",
    "    return dict(zip(header.split(sep), map(value, row.split(sep))))\n",
    "\n",
    "def mlb_convert(stats: dict) -> str:\n",
    "    \"\"\"Given baseball stats return a string '11...FFF'.\"\"\"\n",
    "    events = Counter({\n",
    "        '1': stats['H'] - stats['2B'] - stats['3B'] - stats['HR'],\n",
    "        '2': stats['2B'], '3': stats['3B'], '4': stats['HR'],\n",
    "        'E': stats['E'],  'B': stats['BB'] + stats['HBP'],\n",
    "        'K': stats['SO'], 'D': stats['DP'], 'S': stats['SH'] + stats['SF']})\n",
    "    events['F'] = stats['PA'] - sum(events.values()) # All unaccounted-for outs\n",
    "    return ''.join(events.elements())                # A str of events"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Below I copy-and-paste the data I need from baseball-reference.com to create the dict `mlb_stats`; convert it to the string `mlb_string`; and use that to create the event generator `mlb_stream`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "mlb_stats = header_row_dict(\n",
    "    \"Year Tms #Bat BatAge R/G G PA AB R H 2B 3B HR RBI SB CS BB SO BA OBP SLG OPS TB GDP HBP SH SF IBB E DP\",\n",
    "    \"\"\"2019 30 1284 27.9 4.84 4828 185377 165622 23346 41794 8485 783 6735 22358 2261 827 15806 42546 \n",
    "    .252 .323 .435 .758 72050 3441 1968 774 1146 752 2882 3981\"\"\")\n",
    "mlb_string = mlb_convert(mlb_stats)\n",
    "mlb_stream = event_stream(mlb_string)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can take a look:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Year': 2019,\n",
       " 'Tms': 30,\n",
       " '#Bat': 1284,\n",
       " 'BatAge': 27.9,\n",
       " 'R/G': 4.84,\n",
       " 'G': 4828,\n",
       " 'PA': 185377,\n",
       " 'AB': 165622,\n",
       " 'R': 23346,\n",
       " 'H': 41794,\n",
       " '2B': 8485,\n",
       " '3B': 783,\n",
       " 'HR': 6735,\n",
       " 'RBI': 22358,\n",
       " 'SB': 2261,\n",
       " 'CS': 827,\n",
       " 'BB': 15806,\n",
       " 'SO': 42546,\n",
       " 'BA': 0.252,\n",
       " 'OBP': 0.323,\n",
       " 'SLG': 0.435,\n",
       " 'OPS': 0.758,\n",
       " 'TB': 72050,\n",
       " 'GDP': 3441,\n",
       " 'HBP': 1968,\n",
       " 'SH': 774,\n",
       " 'SF': 1146,\n",
       " 'IBB': 752,\n",
       " 'E': 2882,\n",
       " 'DP': 3981}"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mlb_stats"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'111111111111111111111111112222222223444444EEEBBBBBBBBBBBBBBBBBBKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKDDDDSSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mlb_string[::1000] # Just look at every 1000th character"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  2 (double)\n",
      "0 outs 0 runs  -2-  F (fly out)\n",
      "1 outs 0 runs  -2-  F (fly out)\n",
      "2 outs 0 runs  -2-  F (fly out)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning(mlb_stream)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "I can simulate:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEWCAYAAACEz/viAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAf9klEQVR4nO3dfZhdZX3u8e9tAhJBTNBAMYmCNYpIa4QRYqlWiQ0JtQbPkdPQ1oyYNi2CL301eE7LEaUlrVblUqlRIglHxUhVIoIhRtBTBWR4kRAozYhCRiIZTQhQUAzc/WM9A4vJntl7kpm9k3B/rmtfe63fetZaz5rAvvd63bJNREQ8vT2j0x2IiIjOSxhERETCICIiEgYREUHCICIiSBhERAQJg4iIIGEQbSbpDyXdLem/JH1V0kEtzNMtyZL+pFa7UtJDtdejktaNbe+fWPcHJK2TtF3S/23SVpKWSPp5ef2TJDVot8M27ikk/S9J35P0sKRrGkxfKulOSY9Lelv7exitSBhE20h6OfAp4K3AIcDDwCebzDMJOAtYX6/bnmv7gIEX8D3gS2PS8R31An8LfL2FtouAk4FXAL8JvBH4s3qDobZxD7IF+Chw3hDTfwC8A7ipbT2KEUsYxIiUb68vro1fJOmDLc7+R8DXbH/H9kPA3wH/Q9Kzh5nnH4HzgZ8N06fDgNcAF7fSCUnPlPQJSZskPVa2yZK+2sr8tpfbvhJ4sIXm3cCHbffZ/gnwYeBtg9o03cZGSp/fIWmDpAfLHsuvS7pW0gOSVkrat7SdJOlySf2StpbhqWXaQZL6JP1+GT9AUq+kBa30w/Y3ba8E7h1i+idsrwV+MZLti/ZKGMSoknS/pN8eYvLLqb4lAmD7h8CjwEuGWNaxQBfwr01WuwD4/7Z/1GI3zwTeALwaOJBqj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gqtg6mCbWsJgiOoDpON1EuA25q2it1G9gxiTNi+uRxmmG/7YkkrgVuBDVSHJZp5j6TXU337vR24kuqZ/e8cqz4PZvsnkv6B6gP93tKPbQ2afgf4sCTVvjUPLGOTpLOAq6m+iV9hu5VHFXcD/yrpWbT2RNLPUB2muUmSqA5bPeVnFG3/XNJ3y4nzK8t5g5cB11az8BDwx1SB++eSbgXupDpUNFKvB76+E/NFh+TS0tgjSHom8F3bXW1e7wG2Hyp7Bl+heoT5Vxq0+xjwNdvfbGf/dkfl3+rbwG/XzvXEbi5hEDEMSR+iOn6+H3AV8O7B3/5Lu0OA42zvNT98tLMkTQem2L6m032J1iUMIiIiJ5AjIiJhEBERJAwiIoKEQUREkDCIiAjgvwEjH13yWWXZEAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEWCAYAAACEz/viAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAd/ElEQVR4nO3deZhcVZ3/8fdnkrAoSxJoMKYTEjCA4G9A7F/AwQUNhsAwBp+RmTAOBM384ii4zijg+BhlccgwI8goaIRIUGQRRWIEYkAiihBpCGRhMW0IpCGQ1oQQRJaE7++Pc0ounep0V1V3Vy+f1/Pcp+89y72nbtdT3zr33DpXEYGZmQ1uf1XvBpiZWf05GJiZmYOBmZk5GJiZGQ4GZmaGg4GZmeFgYGZmOBhYnUj6rqSQ9KYO8veXdKOkNkkbJC2UdEC7Mp+R9JSkTZLmStqxl9p+e27Xs5IekDR1O2Xfk8tvkrSmTP64nP+8pIclHd2jje8Bkj4naYWkzZIelfS5dvldPl9WPw4G1uskv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76RzcFxFdmep4OnCBpGWkWULP7qT8ZcCDwH35kti3adfjj4g/Anfmc3lBRPwc+AFwl6TlwPWkYHELMDQf+xzSpaJKvQf4WRX1rM48a6n1G5J2BO6MiKZC2i4R8Vz+QP4msCoiLuzFNn2dNGB6a28ds6/K/59fAu8ojO9YP+GegfUbEfFiMRBk/y8Pnq4kXeb49rY1e9RXgdf18jH7qrHAmQ4E/ZN7BmZm5p6BmZk5GJiZGQ4GZmaGg4GZmeFgYGZmwP8HkWLl1AemsFIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 2.39 s, sys: 21.8 ms, total: 2.41 s\n",
      "Wall time: 2.46 s\n"
     ]
    }
   ],
   "source": [
    "%time simulate(events=mlb_stream)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That looks a *lot* more like real baseball. But MLB averaged 4.84 runs per team per game in 2019, and this is significantly lower. I think we can make some minor changes to the function `inning`&mdash;some \"standard baseball things\"&mdash;to make the simulation more realistic. I'm thinking of two changes:\n",
    "- The most common double play eliminates the batter and the runner on first, not the runner closest to home. \n",
    "- On a single, a runner on second often scores. \n",
    "\n",
    "I'll make those two things the case for all double plays and singles."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def inning2(events, verbose=False) -> int:\n",
    "    \"\"\"Simulate a half inning based on events, and return number of runs scored.\"\"\"\n",
    "    outs = runs = 0     # Inning starts with no outs and no runs,\n",
    "    runners = set()     # and with nobody on base\n",
    "    def out(r) -> int: runners.remove(r); return 1\n",
    "    def forced(r) -> bool: return all(b in runners for b in range(r))\n",
    "    def advance(r, e) -> int: \n",
    "        return ((2 if r == 2 else int(e)) if e in '1234' else \n",
    "                (e in 'ESD' or (e == 'B' and forced(r))))    \n",
    "    for e in events:\n",
    "        if verbose: show(outs, runs, runners, e)\n",
    "        runners.add(batter)           # Batter steps up to the plate\n",
    "        if e == 'D' and 1 in runners: # Double play: batter and runner on first out\n",
    "            outs += out(batter) + out(1)\n",
    "        elif e in 'DSKOF':            # Batter is out\n",
    "            outs += out(batter)  \n",
    "        if outs >= 3:                 # If inning is over: return runs scored\n",
    "            return runs \n",
    "        runners = {r + advance(r, e) for r in runners} # Runners advance\n",
    "        runs += len(runners & scored)                  # Tally runs\n",
    "        runners = runners - scored                     # Remove runners who scored"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We show the difference with two examples. First, a triple/walk/double-play sequence scores a run under `inning2` but not `inning`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  3 (triple)\n",
      "0 outs 0 runs  3--  B (base on balls)\n",
      "0 outs 0 runs  3-1  D (double play)\n",
      "2 outs 1 runs  ---  K (strikeout)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning2('3BDK', True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  3 (triple)\n",
      "0 outs 0 runs  3--  B (base on balls)\n",
      "0 outs 0 runs  3-1  D (double play)\n",
      "2 outs 0 runs  -2-  K (strikeout)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning('3BDK', True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Second, a double/single sequence scores a run under `inning2` but not `inning`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  2 (double)\n",
      "0 outs 0 runs  -2-  1 (single)\n",
      "0 outs 1 runs  --1  F (fly out)\n",
      "1 outs 1 runs  --1  F (fly out)\n",
      "2 outs 1 runs  --1  F (fly out)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning2('21FFF', True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 outs 0 runs  ---  2 (double)\n",
      "0 outs 0 runs  -2-  1 (single)\n",
      "0 outs 0 runs  3-1  F (fly out)\n",
      "1 outs 0 runs  3-1  F (fly out)\n",
      "2 outs 0 runs  3-1  F (fly out)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inning('21FFF', True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can simulate again and note any differences:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEWCAYAAACT7WsrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfRklEQVR4nO3de7xVdZ3/8dc7kMQroGgEFFZ4n5H0hDhmY1II5og9Jh+DU3IyGiYjzZmpCfv9Jn6ZNjqXLk5p4ygjOKaZZZKDIZF0MW/HSyCScSKFEygnQcIsSfz8/ljfo8vD/p699+Gcsw/wfj4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wC2UdxA8VUk7U+xzT9MpXmleaDy5zUJmJ4+//uAAygCoCuT0uthipA7vDTPBZJ+BtxLcWPLjvpWXgnp5RSfzx/TcEdfoLhx3OurrN92Ar53k/Wk30fEuPQldzswC7iC4v445R8knR8V+UJ630b6PxkRl0n6X+A04F5J76L4glqbHvrU2R/jlRNsLy+n0/Kh8i3fO7fpmD/XtrPfA/tnpnW1jD908zzEdp9XWs/5EbGojuUI+OeI+M9XFaWTKe6UekJEPC9pKa/8m5U/55c6+hIRL6l4gE+HPXll7892Yt6TsB4XEZspHg/5CRW3G38SOFLSa1OATKy2DElvjojlEXE5xaGLw8kfauot9wN/Lmlo+gL8y0y7lcBbMtPuS8s4MB2GOxv4YaYt8PLnt6l0ZdQ51eahuPHkeenzRtKh2v7hQVuAfTvN8yEVzwxBxRVjB1EE3qYUEIdTHG6r16HAo1VbWb/nPQnrFRHxcDpcMS0irpd0M7AMWEVxeKOaCyW9k+LX8mPAHRTPOji/t/rcWUT8WtLnKb7o16V+bK7Q9EfAv0tS6Vd2xzLWS7oIuIvil/vCiKh6e2aK2zh/TdJe1HZn1msoDvc8JEkUh79e9WjKiHhG0t3phP0d6bzEEcA9xSw8B3yAIog/ImkZ8DjFIad6vRP4327MZ/2ML4G1nYKk1wJ3R0RTH693n4h4Lu1J3Epxi/hbK7T7MvDdiPh+X/avP0r/Vj8E3l46l2Q7KYeEWRck/RvF8fk9gTuBj3feW0jtDgaOj4hd9kFUtZI0FhgZEUsb3RfbcQ4JMzPL8olrMzPLckiYmVmWQ8LMzLIcEmZmluWQMDOzrP8PWOaRJE9Q/JIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEWCAYAAACEz/viAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh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NG2NyS634T+FdJt5GuX1TqI8DUvO9VlP8Z1FuBt5broUQa0fN84BbSMbgnInoy1HELcLGkFaRRQi/opvwVwIPAPfmU2OV06PFHxB+B2/KxvDgifg38B3C7pJXAtaRkcSMwNO/7QtKpokq9B/hVFfWszjxqqe0wJO0G3BYRzYXYXhHxp/yB/H1gTUTM6sc2fZd0wfQ3/bXPgSr/f34LvLNwfcd2EO4Z2A4jIl4sJoLsf+eLp6tIpzku375mn/o6sGc/73OgGgOc50SwY3LPwMzM3DMwMzMnAzMzw8nAzMxwMjAzM5wMzMwM+P/o9xVhi+TN1gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 2.37 s, sys: 17.1 ms, total: 2.39 s\n",
      "Wall time: 2.41 s\n"
     ]
    }
   ],
   "source": [
    "%time simulate(events=mlb_stream, inning=inning2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There is a slight increase in the number of runs.\n",
    "\n",
    "# Opportunities for Improvement\n",
    "\n",
    "There are many problems with the code as it is. For example:\n",
    "\n",
    "- It assumes all teams are equal. They're not.\n",
    "- It assumes all pitchers and defense are equal. They're not.\n",
    "- It assumes all batters are equal. They're not. (I think this is the main place where we get a shortfall in runs: real lineups cluster their best hitters together, and they are more apt to produce runs than a lineup of all median players.)\n",
    "- It assumes all hits are the same (runners always advance the same number of bases). They're not.\n",
    "- There's only one type of double play (batter and runner on first out) and no triple play.\n",
    "- It ignores stolen bases, pickoffs, passed balls, wild pitches, runners taking extra bases, and runners being out on attempted steals, extra bases, or sacrifices.\n",
    "- There is no strategy (offense and defense behave the same, regardless of the situation).\n",
    "- It assumes both teams bat for 9 innings. But if the home team is ahead at the bottom of the 9th, they do not bat, and if the score is tied: extra innings.\n",
    "- With two outs, or with no runners on base, there can be no sacrifice or double play; those types of events would just be regular outs. The stats say that a double play should occur in 3981 out of 185377 at bats, or about 2% of the time. In our simulation the `D` event code would come up that often, but perhaps only half the time there would be a runner and less than two outs, so we would only actually get a double play maybe 1% of the time.\n",
    "\n",
    "\n",
    "What can you do to make the simulation better?"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
